#include "led.h"

static uint64_t led_buf;

void led_setpwron(bool leden)
{
    if(leden)
    {
        u32srbuf |= 1 << led1;
        u32srbuf |= 1 << led2;
        sr_senddata(u32srbuf);
    }
    else
    {
        u32srbuf &= ~(1 << led1);
        u32srbuf &= ~(1 << led2);
        sr_senddata(u32srbuf);
    }
}

void led_setcolor(uint64_t u64color)
{
    uint32_t tmp = u64color;
    for(uint8_t i = 0; i < 64; i ++)
    {
         if(tmp & 1)
        {
            HV_DIN_H;
        }
        else
        {
            HV_DIN_L;
        }
        tmp >>= 1;
    }
    HV_DIN_L;
}